package com.vctgo.demo.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.vctgo.demo.mapper.AccountingCategoriesMapper;
import com.vctgo.demo.domain.AccountingCategories;
import com.vctgo.demo.service.IAccountingCategoriesService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.vctgo.common.core.text.Convert;
import com.vctgo.common.core.utils.ServletUtils;
import com.vctgo.common.mybatisplus.constant.MybatisPageConstants;
/**
 * 核算类别设置Service业务层处理
 *
 * @author vctgo
 * @date 2024-12-17
 */
@Service
public class AccountingCategoriesServiceImpl implements IAccountingCategoriesService
{
    @Autowired
    private AccountingCategoriesMapper accountingCategoriesMapper;

    /**
     * 查询核算类别设置
     *
     * @param id 核算类别设置主键
     * @return 核算类别设置
     */
    @Override
    public AccountingCategories selectAccountingCategoriesById(Long id)
    {
        return accountingCategoriesMapper.selectById(id);
    }

    /**
     * 查询核算类别设置列表-分页
     *
     * @param accountingCategories 核算类别设置
     * @return 核算类别设置
     */
    @Override
    public IPage<AccountingCategories> selectAccountingCategoriesPage(AccountingCategories accountingCategories)
    {
        Page mpPage =new Page(Convert.toLong(ServletUtils.getParameterToInt(MybatisPageConstants.PAGE_NUM),1L)
                ,Convert.toLong(ServletUtils.getParameterToInt(MybatisPageConstants.PAGE_SIZE),10L));
        return accountingCategoriesMapper.selectAccountingCategoriesList(mpPage,accountingCategories);
    }
    /**
     * 查询核算类别设置列表
     *
     * @param accountingCategories 核算类别设置
     * @return 核算类别设置
     */
    @Override
    public List<AccountingCategories> selectAccountingCategoriesList(AccountingCategories accountingCategories)
    {
        return accountingCategoriesMapper.selectAccountingCategoriesList(accountingCategories);
    }

    /**
     * 新增核算类别设置
     *
     * @param accountingCategories 核算类别设置
     * @return 结果
     */

    @Override
    public int insertAccountingCategories(AccountingCategories accountingCategories)
    {
        return accountingCategoriesMapper.insert(accountingCategories);
    }

    /**
     * 修改核算类别设置
     *
     * @param accountingCategories 核算类别设置
     * @return 结果
     */
    @Override
    public int updateAccountingCategories(AccountingCategories accountingCategories)
    {
        return accountingCategoriesMapper.updateById(accountingCategories);
    }

    /**
     * 批量删除核算类别设置
     *
     * @param ids 需要删除的核算类别设置主键
     * @return 结果
     */
    @Override
    public int deleteAccountingCategoriesByIds(Long[] ids)
    {
        return accountingCategoriesMapper.deleteAccountingCategoriesByIds(ids);
    }

    /**
     * 删除核算类别设置信息
     *
     * @param id 核算类别设置主键
     * @return 结果
     */
    @Override
    public int deleteAccountingCategoriesById(Long id)
    {
        return accountingCategoriesMapper.deleteById(id);
    }
}
